//
//  LeBehaviour.h
//  Leste
//
//  Created by 王乐 on 2022/1/26.
//

#ifndef LeBehaviour_hpp
#define LeBehaviour_hpp

class LeTransform;
class LeRigidBody;
class LeRenderer;
class LeParticleSystem;
class LeGameObject;

class LeBehaviour
{
public:
    LeBehaviour(){}
    virtual~LeBehaviour(){}
    
public:
    void initBehaviour(LeRigidBody* pRigidBody, LeRenderer* pRenderer,LeParticleSystem* pParicleSystem, LeGameObject* pGameObject);
    
    virtual void Awake();       // Called when gameobject is created.
    virtual void Start();       // Called right before gameloop
    virtual void PreRender();   // Called right before gameloop
    
    virtual void Update();      // Called in gameloop
    virtual void FixedUpdate(); // Called in gameloop
    virtual void Render();      // Called in gameloop
    
    virtual void PostRender();  // Called after gameloop
    
    virtual void OnContactBegin(LeGameObject* other);  // Collision detection
    virtual void OnContactEnd(LeGameObject* other);    // Collision detection
    
protected:
    LeTransform* m_pTransform;
    LeGameObject* m_pGameObject;
    LeRigidBody* m_pRigidBody;
    LeRenderer* m_pRenderer;
    LeParticleSystem* m_pParticleSystem;
};

#endif /* LeBehaviour_hpp */
